<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
</head>
<body>
    <button id="btnGET">GET</button>
    <button id="btnPOST">POST</button>
    <button id="jsonpGET">jsonpGET</button>
</body>
<script>
$(function(){
    $("#btnGET").on("click",function(){
        $.ajax({
            type:"GET",
            url:"http://localhost:8080/api/username",
            success:function(res){
                console.log(res);
            }
        })
    })
    $("#btnPOST").on("click",function(){
        $.ajax({
            type:"POST",
            url:"http://localhost:8080/api/login",
            data:{
                username:"admin",
                password:"000000"
            },
            success:function(res){
                console.log(res);
            }
        })
    })
    $("#jsonpGET").on("click",function(){
        $.ajax({
            type:"GET",
            url:"http://localhost:8080/api/logout",
            success:function(res){
                console.log(res);
            }
        })
    })
})

</script>
</html>